package com.weitu.environmental.solidWaste.service.impl;

import com.weitu.environmental.solidWaste.entity.SolidWasteStorageView;
import com.weitu.environmental.solidWaste.entity.StorageSource;
import com.weitu.environmental.solidWaste.mapper.SolidWasteStorageViewMapper;
import com.weitu.environmental.solidWaste.service.SolidWasteStorageViewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author zhangqingxi 2017-04-17
 */
@Service
public class SolidWasteStorageViewServiceImpl implements SolidWasteStorageViewService {


    private final SolidWasteStorageViewMapper solidWasteStorageViewMapper;


    @Autowired
    public SolidWasteStorageViewServiceImpl(SolidWasteStorageViewMapper solidWasteStorageViewMapper) {

        this.solidWasteStorageViewMapper = solidWasteStorageViewMapper;
    }

    @Override
    public List<SolidWasteStorageView> findByParam(Map paramMap) {
        return solidWasteStorageViewMapper.findByParam(paramMap);
    }

    @Override
    public List<StorageSource> findStorageSourceByParam(Map paramMap) {
        return solidWasteStorageViewMapper.findStorageSourceByParam(paramMap);
    }

    @Override
    public Integer findByParamCount(Map paramMap) {
        return solidWasteStorageViewMapper.findByParamCount(paramMap);
    }

    @Override
    public Integer findStorageSourceByParamCount(Map paramMap) {
        return solidWasteStorageViewMapper.findStorageSourceByParamCount(paramMap);
    }

    @Override
    public SolidWasteStorageView findEntityByParams(Map paramMap) {
        List<SolidWasteStorageView> solidWasteStorageViewList=solidWasteStorageViewMapper.findEntityByParams(paramMap);
        if (solidWasteStorageViewList.size()>0){
            return solidWasteStorageViewList.get(0);
        }
        return null;
    }


}
